package com.localjoycommunity.cpdj.project.system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.localjoycommunity.cpdj.project.system.mapper.BuildingMapper;
import com.localjoycommunity.cpdj.project.system.domain.Building;
import com.localjoycommunity.cpdj.project.system.service.IBuildingService;

/**
 * 楼宇Service业务层处理
 *
 * @author leepandar
 * @date 2021-01-19
 */
@Service
public class BuildingServiceImpl implements IBuildingService {
    @Autowired
    private BuildingMapper buildingMapper;

    /**
     * 查询楼宇
     *
     * @param buildingId 楼宇ID
     * @return 楼宇
     */
    @Override
    public Building selectBuildingById(Long buildingId) {
        return buildingMapper.selectBuildingById(buildingId);
    }

    /**
     * 查询楼宇列表
     *
     * @param building 楼宇
     * @return 楼宇
     */
    @Override
    public List<Building> selectBuildingList(Building building) {
        return buildingMapper.selectBuildingList(building);
    }

    /**
     * 新增楼宇
     *
     * @param building 楼宇
     * @return 结果
     */
    @Override
    public int insertBuilding(Building building) {
        return buildingMapper.insertBuilding(building);
    }

    /**
     * 修改楼宇
     *
     * @param building 楼宇
     * @return 结果
     */
    @Override
    public int updateBuilding(Building building) {
        return buildingMapper.updateBuilding(building);
    }

    /**
     * 批量删除楼宇
     *
     * @param buildingIds 需要删除的楼宇ID
     * @return 结果
     */
    @Override
    public int deleteBuildingByIds(Long[] buildingIds) {
        return buildingMapper.deleteBuildingByIds(buildingIds);
    }

    /**
     * 删除楼宇信息
     *
     * @param buildingId 楼宇ID
     * @return 结果
     */
    @Override
    public int deleteBuildingById(Long buildingId) {
        return buildingMapper.deleteBuildingById(buildingId);
    }
}
